<?php

namespace App\Services;

use Cisco\Aliyunsms\Facades\Aliyunsms;

class AliMsg
{
    static public function send($phoneNumber){
        $SignName     = config('aliyunsms.options.sign_name');          //模板签名
        $TemplateCode = config('aliyunsms.options.template_code');         //模板CODE

        $code = rand(100000,999999);
        $TemplateParam = [
            "code"    => $code,
            "product" => "dsd"
        ];

        $send = Aliyunsms::sendSms(strval($phoneNumber), $SignName, $TemplateCode, $TemplateParam);

        if ($send->Code == 'OK') {
            return $code;
        } else {
            return false;
        }
    }
}
